home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 October: Technology Seed / ADC Seed CD - October 1999.toast / FireWire / FireWire_2.1_SDK_DR3 / Source / FWiX / FWiXFamily / FWiX.h next >
Encoding:
C/C++ Source or Header  |  1999-05-17  |  6.4 KB  |  284 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        FWiX.h
  3.  
  4.     Contains:    Definitions and interfaces for FireWire File Exchange driver
  5.                 family.
  6.  
  7.     Version:    1.0
  8.  
  9.     Written by:    Jay Lloyd
  10.  
  11.     Copyright:    © 1996-1998 by Apple Computer, Inc., all rights reserved.
  12.  
  13.     File Ownership:
  14.  
  15.         DRI:                Jay Lloyd
  16.  
  17.         Other Contact:        
  18.  
  19.         Technology:            FireWire
  20.  
  21.     Writers:
  22.  
  23.         (jkl)    Jay Lloyd
  24.  
  25.     Change History (most recent first):
  26.  
  27.         <16>     1/15/98    jkl        Update for new interfaces.
  28.       <FW15>     2/21/97    jkl        Added packet types for handling sending data to non notify
  29.                                     address space.
  30.       <FW14>     2/19/97    jkl        Added node info request and reply packet types.
  31.       <FW13>     2/14/97    jkl        Added flow control packet header constants.
  32.       <FW12>     2/11/97    jkl        Modified buffer sizes and counts.
  33.       <FW11>      2/7/97    ES        Added procedure prototype for GetNextFWXClientEvent.
  34.       <FW10>      2/2/97    jkl        Modified buffer sizes and values for performance improvements.
  35.        <FW9>     1/27/97    jkl        Added transfer status packet types.
  36.        <FW8>     1/16/97    jkl        Add user interface features for alpha candidate. Notification
  37.                                     packet type.
  38.        <FW7>      1/8/97    ES        Added support for FWX nodes.
  39.        <FW6>    11/13/96    jkl        Added constants and declarations for multiple machine support
  40.                                     and stop transfer.
  41.        <FW5>     11/5/96    ES        Changed kFWWriteSize to 3*kFWPayloadSize to fix flow control
  42.                                     bug.
  43.        <FW4>     10/31/96    jkl        Added constants for folder copy.
  44.        <FW3>     10/16/96    jkl        Renamed constants for clarity. Changed
  45.                                     buffer and payload size for performance tests.
  46.        <FW2>     10/3/96    jkl        Upped value of file read/write buffer size
  47.                                     Had it set low for testing.
  48.        <FW1>     10/2/96    jkl        initial check-in, copied from avt family
  49.  
  50. */
  51.  
  52. #ifndef __FWIX__
  53. #define __FWIX__
  54.  
  55. #ifndef __TYPES__
  56. #include <Types.h>
  57. #endif
  58. #ifndef __APPLEEVENTS__
  59. #include <AppleEvents.h>
  60. #endif
  61. #ifndef __NAMEREGISTRY__
  62. #include <NameRegistry.h>
  63. #endif
  64.  
  65. #ifdef __cplusplus
  66. extern "C" {
  67. #endif
  68.  
  69. #if PRAGMA_IMPORT_SUPPORTED
  70. #pragma import on
  71. #endif
  72.  
  73. #if PRAGMA_ALIGN_SUPPORTED
  74. #pragma options align=mac68k
  75. #endif
  76.  
  77. ////////////////////////////////////////////////////////////////////////////////
  78. //
  79. // FireWire File Exchange driver family typedefs.
  80. //
  81.  
  82. #define FWXDriverInterfacePascalName "\pFWXDriverInterface"
  83.  
  84. #define kFWPacketSize            1024                // FireWire packet size
  85. #define kFWControlBufferSize    1024                // Size of FireWire control buffer
  86. #define kFWDataBufferSize        (32*1024)            // Size of FireWire data buffer
  87.  
  88. typedef struct OpaqueFWXClientID*        FWXClientID;
  89. typedef struct OpaqueFWXDriverID*        FWXDriverID;
  90. typedef struct OpaqueFWXNodeID*            FWXNodeID;
  91.  
  92. enum {                                    // packet header types
  93.     kStartFile        = 1,
  94.     kEndFile        = 2,
  95.     kStartDataFork    = 3,
  96.     kEndDataFork    = 4,
  97.     kStartResFork    = 5,
  98.     kEndResFork        = 6,
  99.     kFileInfo        = 7,
  100.     kForkData        = 8,
  101.     kStartFolder    = 9,
  102.     kEndFolder        = 10,
  103.     kFolderInfo            = 11,
  104.     kNodeInfoRequest    = 12,
  105.     kNodeInfoReply        = 13,
  106.     kQuitNotify            = 14,
  107.     kPreflightCopy        = 15,
  108.     kPreflightReply        = 16,
  109.     kReceiveReply        = 17,
  110.     kFCDataRequest        = 18,
  111.     kFCControlRequest    = 19,
  112.     kFCDataReply        = 20,
  113.     kFCControlReply        = 21,
  114.     kTransferStopped    = 22,
  115.     kDataDone            = 23,
  116.     kAddressInfoRequest    = 24,
  117.     kAddressInfoReply    = 25
  118. };
  119.  
  120. enum
  121. {
  122.     kInvalidFWXClientID            = 0,
  123.     kInvalidFWXDriverID            = 0,
  124.     kInvalidFWXNodeID            = 0
  125. };
  126.  
  127. enum
  128. {
  129.     kServiceCategoryFWiX    = 'FWiX'
  130. };
  131.  
  132. enum
  133. {
  134.     // Apple event class for FireWire File Exchange driver family.
  135.     kAEFWXEventClass    = 'FWiX',
  136.  
  137.     // Apple events sent by FireWire File Exchange driver family.
  138.     kAEFWXDeviceAdded    = 'ADDD',
  139.     kAEFWXDeviceRemoved    = 'RMVD',
  140.  
  141.     // Parameters used by FireWire File Exchange driver family Apple events.
  142.     kAEFWXNodeIDKey                = 'NDID',
  143.     kAEFWXNodeIDType            = typeLongInteger //zzz should we have our own???
  144. };
  145.  
  146. struct FWXInterfaceParamsStruct
  147. {
  148.     UInt32                        interfaceSelector;
  149.     Ptr                            pDriverSpecificData;
  150.     Ptr                            pNodeSpecificData;
  151. };
  152. typedef struct FWXInterfaceParamsStruct
  153.                                 FWXInterfaceParams,
  154.                                 *FWXInterfaceParamsPtr;
  155.  
  156. typedef OSStatus
  157.     (FWXInterfaceProc) (
  158.         FWXInterfaceParamsPtr    pInterfaceParams);
  159. typedef FWXInterfaceProc        *FWXInterfaceProcPtr;
  160.  
  161. enum
  162. {
  163.     kFWXInitialize        = 1,
  164.     kFWXTerminate        = 2,
  165.     kFWXWrite            = 3,
  166.     kFWXRead            = 4,
  167.     kFWXKillIO            = 5,
  168.     kFWXOpenNode        = 6,
  169.     kFWXCloseNode        = 7
  170. };
  171.  
  172. struct FWXInitializeParamsStruct
  173. {
  174.     FWXInterfaceParams            fwxInterfaceParams;
  175.     RegEntryID                    *pDriverRegEntry;
  176.     FWXDriverID                    fwxDriverID;
  177. };
  178. typedef struct FWXInitializeParamsStruct
  179.                                 FWXInitializeParams,
  180.                                 *FWXInitializeParamsPtr;
  181.  
  182. struct FWXTerminateParamsStruct
  183. {
  184.     FWXInterfaceParams            fwxInterfaceParams;
  185.     RegEntryID                    *pDriverRegEntry;
  186. };
  187. typedef struct FWXTerminateParamsStruct
  188.                                 FWXTerminateParams,
  189.                                 *FWXTerminateParamsPtr;
  190.  
  191. struct FWXAsynchParamsStruct
  192. {
  193.     FWXInterfaceParams            fwxInterfaceParams;
  194.     IOParamPtr                    pIOPB;
  195. };
  196. typedef struct FWXAsynchParamsStruct
  197.                                 FWXAsynchParams,
  198.                                 *FWXAsynchParamsPtr;
  199.  
  200. struct FWXOpenNodeParamsStruct
  201. {
  202.     FWXInterfaceParams            fwxInterfaceParams;
  203.     UInt32                        fwxNodeRegistrationReference;
  204. };
  205. typedef struct FWXOpenNodeParamsStruct
  206.                                 FWXOpenNodeParams,
  207.                                 *FWXOpenNodeParamsPtr;
  208.  
  209. struct FWXCloseNodeParamsStruct
  210. {
  211.     FWXInterfaceParams            fwxInterfaceParams;
  212.     UInt32                        fwxNodeRegistrationReference;
  213. };
  214. typedef struct FWXCloseNodeParamsStruct
  215.                                 FWXCloseNodeParams,
  216.                                 *FWXCloseNodeParamsPtr;
  217.  
  218.  
  219. ////////////////////////////////////////////////////////////////////////////////
  220. //
  221. // FireWire File Exchange driver family services.
  222. //
  223.  
  224. OSStatus    RegisterFWXClientApplication (
  225.     FWXClientID                    *pFWXClientID,
  226.     UInt32                        clientContextData);
  227.  
  228. OSStatus    UnregisterFWXClientApplication (
  229.     FWXClientID                    fwxClientID);
  230.  
  231. OSStatus    GetFWXDriverList (
  232.     FWXDriverID                    *pFWXDriverIDList,
  233.     UInt32                        fwxDriverIDListSize,
  234.     UInt32                        *pNumFWXDrivers);
  235.  
  236. OSStatus    CallFWXDriver (
  237.     IOParamPtr                    pIOPB);
  238.  
  239. OSStatus    OpenFWXDriver (
  240.     FWXDriverID                    fwxDriverID);
  241.  
  242. OSStatus    CloseFWXDriver (
  243.     FWXDriverID                    fwxDriverID);
  244.  
  245. OSStatus    GetFWXNodeList (
  246.     FWXNodeID                    *pFWXNodeIDList,
  247.     UInt32                        fwxNodeIDListSize,
  248.     UInt32                        *pNumFWXNodes);
  249.  
  250. OSStatus    CallFWXNode (
  251.     IOParamPtr                    pIOPB);
  252.  
  253. OSStatus    OpenFWXNode (
  254.     FWXNodeID                    fwxNodeID);
  255.  
  256. OSStatus    CloseFWXNode (
  257.     FWXNodeID                    fwxNodeID);
  258.  
  259. OSStatus    RegisterFWXNode (
  260.     FWXDriverID                    fwxDriverID,
  261.     UInt32                        fwxNodeRegistrationReference);
  262.  
  263. OSStatus    UnregisterFWXNode (
  264.     FWXDriverID                    fwxDriverID,
  265.     UInt32                        fwxNodeRegistrationReference);
  266.  
  267. OSStatus    GetNextFWXClientEvent (
  268.     FWXClientID                    fwxClientID);
  269.  
  270.  
  271. #if PRAGMA_ALIGN_SUPPORTED
  272. #pragma options align=reset
  273. #endif
  274.  
  275. #if PRAGMA_IMPORT_SUPPORTED
  276. #pragma import off
  277. #endif
  278.  
  279. #ifdef __cplusplus
  280. }
  281. #endif
  282.  
  283. #endif /* FWIX */
  284.